<extend name="Base/common"/>

<block name="body">
	<div class="mui-content">
	    <div id="slider" class="mui-slider" >
	      <div class="mui-slider-group mui-slider-loop">
	        <div class="mui-slider-item mui-slider-item-duplicate">
	        	<gt name="banner_info.last.content" value="0">
	            <a href="{:U('snatch/detail',['id'=>$banner_info['last']['content']])}"><img src="{$banner_info.last.cover_id|get_cover='path'}"></a>
	        	<else />
	            <img src="{$banner_info.last.cover_id|get_cover='path'}">
	        	</gt>
	        </div>
	      	<foreach name="banner_info.list" item='vo'>	      		
	        <!-- 第一张 -->
	        <div class="mui-slider-item">
	        	<gt name="vo.content" value="0">
	        	<a href="{:U('snatch/detail',['id'=>$vo['content']])}">
	            <img src="{$vo.cover_id|get_cover='path'}">
	        	</a>
	        	<else />
	            <img src="{$vo.cover_id|get_cover='path'}">
	        	</gt>
	        </div>
	      	</foreach>
	        <!-- 额外增加的一个节点(循环轮播：最后一个节点是第一张轮播) -->
	        <div class="mui-slider-item mui-slider-item-duplicate">
	        	<gt name="banner_info.first.content" value="0">
	            <a href="{:U('snatch/detail',['id'=>$banner_info['first']['content']])}"><img src="{$banner_info.first.cover_id|get_cover='path'}"></a>
	        	<else />
	            <img src="{$banner_info.first.cover_id|get_cover='path'}">
	        	</gt>
	        </div>
	      </div>
	    </div>
	</div>
	<div class="index_label">
        <li class="mui-table-view-cell">
            <a class="mui-navigate-right" href="{:U('snatch/index',['status'=>1])}">进行中</a>
        </li>		
	</div>
    <div class="mui-row">

    	<foreach name="snatch_list" item="vo">
        <div class="mui-col-sm-6 mui-col-xs-6 index_snatch_list">
        	<div class="index_snatch_item">
        		<a href="{:U('snatch/detail',['id'=>$vo['id']])}">
	            <div class="snatch_item_img">
	            	<empty name="vo.pic">
	            	<img src="http://placehold.it/335x180"/>
	            	<else />
	            	<img src="{$vo.pic|get_cover='path'}"/>
	            	</empty>
	            </div>
	            <div class="snatch_item_title">第{$vo.id}期：{$vo.title}</div>
	            </a>
	            <div class="mui-row">
	            	<div class="mui-col-xs-8">	            		
	            		<div class="process_text">揭晓进度{$vo.progress|default='0'}%</div>
	            		<div class="process_bg">
	            			<img src="__IMG__/progress.png" width="{$vo.progress|default='0'}%"/>
	            		</div>
	            	</div>
	            	<div class="mui-col-xs-4 img_btn_join">
	            		<a href="{:U('snatch/getCode',array('id'=>$vo['id']))}"><img src="__IMG__/join_red.png" id="img_btn_join" /></a>
	            	</div>
	            </div>
        	</div>
        </div>
        <if condition="($key % 2) eq 1">
        	<div class="clear"></div>
        </if>
    	</foreach>
    </div>
	<div class="index_label">
        <li class="mui-table-view-cell">
            <a class="mui-navigate-right" href="{:U('snatch/index',['status'=>2])}">往期揭晓</a>
        </li>		
	</div>
	<div>
		<foreach name="lottery_list" item="vo">
		<div class="mui-row last_lottery">
			<div class="mui-col-xs-5 item_img">
        		<a href="{:U('snatch/detail',['id'=>$vo['id']])}">
	            	<empty name="vo.pic">
	            	<img src="http://placehold.it/250x150"/>
	            	<else />
	            	<img src="{$vo.pic|get_cover='path'}"/>
	            	</empty>
        		</a>
			</div>
			<div class="mui-col-xs-7 mui-navigate-right item_info">
				<li class="item_lottery_info">
        			<a href="{:U('snatch/detail',['id'=>$vo['id']])}">第{$vo.id}期:{$vo.title}</a>
				</li>
				<li class="item_lottery_info">
					获奖者:<span>{$vo.lottery_uid|get_username|substr_cut}</span>
				</li>
				<li class="item_lottery_info">
					幸运号码:<span>{$vo.lottery_code}</span>
				</li>
				<li class="item_lottery_time">
					揭晓时间:<span>{$vo.lottery_time|date="Y-m-d H:i",###}</span>
				</li>
			</div>
		</div>
		</foreach>
	</div>
	<div class="float_add_snatch">
		<a href="{:U('snatch/add')}">
			<img src="__IMG__/add_snatch.png">
		</a>
	</div>
	<nav class="mui-bar mui-bar-tab">
	    <a class="mui-tab-item mui-active" href="{:U('index/index')}">
	        <span class="mui-icon icon-renpin"></span>
	        <span class="mui-tab-label">人品大爆发</span>
	    </a>
	    <a class="mui-tab-item" href="{:U('snatch/index')}">
	        <span class="mui-icon icon-huodong"></span>
	        <span class="mui-tab-label">全部活动</span>
	    </a>
	    <a class="mui-tab-item" href="{:U('mine/index')}">
	        <span class="mui-icon icon-mine"></span>
	        <span class="mui-tab-label">我的</span>
	    </a>
	</nav>
</block>
<block name="script">
	<script type="text/javascript">
		mui('.mui-bar-tab').on('tap','a',function(){
			var url = this.attributes['href'].value;
			mui.openWindow({
				url:url
			});
		});
	</script>
</block>
